﻿Imports System
Imports System.IO
Imports System.Data
Imports System.Data.SqlServerCe
Imports System.Drawing
Imports System.Collections
Imports System.Windows.Forms
Imports System.Data.Common

Module ProjectDao

    Public Function findProjects(ByVal projectId As String, ByVal statusCode As String) As DataTable
        Dim dtResult As New DataTable
        Dim paramList As New Hashtable()

        Dim SQL As String = "SELECT * FROM eqam_project WHERE 1=1"

        If (projectId IsNot Nothing) Then
            SQL = SQL & " AND PROJECT_ID = @projectId"
            paramList.Add("@projectId", projectId)            
        End If

        If (statusCode IsNot Nothing) Then
            SQL = SQL & " AND STATUS_CODE = @STATUS_CODE"
            paramList.Add("@STATUS_CODE", statusCode)            
        End If

        Return LoadData(SQL, paramList)        
    End Function
End Module
